import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooComponentSettingController } from '../../../controllers';
const uctoocomponentSettingRouter = new Router();
const componentSettingController = new uctooComponentSettingController();

uctoocomponentSettingRouter.post('/add', requireUser, componentSettingController.add);
uctoocomponentSettingRouter.post('/edit', requireUser, rowLevelPermission('uctoo/component_setting'), componentSettingController.edit);
uctoocomponentSettingRouter.post('/del', requireUser, rowLevelPermission('uctoo/component_setting'), componentSettingController.delete);

//For getting componentSetting with permission control
uctoocomponentSettingRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/component_setting'), componentSettingController.getSingle);
uctoocomponentSettingRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/component_setting'), componentSettingController.getMany);
uctoocomponentSettingRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/component_setting'), componentSettingController.getMany);

//#endregion AutoCreateCode
uctoocomponentSettingRouter.post('/initSetting', requireUser, componentSettingController.initSetting);
export default uctoocomponentSettingRouter;
